package com.magic.uschat;

import com.lidroid.xutils.view.annotation.ContentView;
import com.magic.uschat.bean.User;
import com.magic.uschat.model.UserModel;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.Menu;
import android.view.MenuItem;

@ContentView(R.layout.activity_splash)
public class SplashActivity extends BaseActivity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Handler handler = new Handler(Looper.getMainLooper());
		handler.postDelayed(new Runnable() {
			@Override
			public void run() {
				User user = UserModel.instance().getCurrentUser();
				if (user==null) {
					startActivity(LoginActivity.class, null, true);
				}else{
					startActivity(MainActivity.class, null, true);
				}
			}
		}, 1000);
	}
}
